home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.2
/
Video Toaster v4.2.iso
/
arexx
/
switcher
/
ldgrab.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-12-13
|
2KB
|
74 lines
/* Grab frames on Sony LVR-3000N */
/* Set serial at 9600 8N1, assume LD just turned on, did blank check */
/* By Arnie Cachelin Mon Oct 19 16:00:02 1992 */
arg count name
cmd.0="56" /* All Clear */
cmd.1="EC" /* Color Mode */
cmd.2="EA" /* NTSC Mode */
cmd.3="55" /* Frame # Mode */
cmd.4="89" /* Field step Mode */
/*cmd.4="88" Frame step Mode */
cmd.5="2B" /* Frame advance */
cmdnum=4
NextFrame=x2c("2B")
OPTIONS RESULTS
TOASTERLIB="ToasterARexx.port"
if arg()=0 then do
say "USAGE: rx LDGrab <# of frames> <name>"
exit
end
if count="" then count=10
if count>1000 then count=1000
if name="" then name=left(date(),6)
IF POS(TOASTERLIB , SHOW('Libraries')) = 0 THEN
IF ~ADDLIB(TOASTERLIB , 0) THEN x=Bummer(" Me No Find Toaster Library!")
if ~open(SerialOut,"SER:","a") then
do
say "Can't open serial port SER:."
exit
end
else
do i=0 to cmdnum /* Send setup commands */
s="command "i" Sent hex byte "cmd.i
writech(SerialOut,x2c(cmd.i))
say s
end
Switcher(TOSW) /* Go to Switcher screen */
Switcher(LVID) /* Set to live digital video */
time(reset)
do f=0 to count
Switcher(FVID) /* Freeze frame */
SaveNextFrame(name)
Switcher(LVID) /* Set to live digital video */
writech(SerialOut,NextFrame)
address command
"wait 1 secs"
end
Switcher(TOWB) /* Go to Workbench screen */
exit
SaveNextFrame: Procedure
arg name
N=Switcher(STAT,KNUM) /* Get the current keypad number */
fs=N+1
do while Switcher(FMXI,fs) &fs~=N /* Is the frame already there? */
if fs=999 then fs=0 /* wrap around at last frame */
else fs=fs+1
end
if fs=N then t=10 /* got to starting frame without finding open fs */
else t=Switcher(FMSV,fs,name) /* Save frame */
say "Saved frame "name" in number "fs " at "time()
return t